local extension = Package:new("huiwan3")
extension.extensionName = "king"
local U = require "packages/utility/utility"


Fk:loadTranslationTable{
    ["huiwan3"] = "会玩3",
  }

  local aoe__huiwan = fk.CreateTriggerSkill{
    name = "aoe__huiwan",
    anim_type = "drawcard",
    events = {fk.GameStart},
    can_trigger = function(self, event, target, player, data)
      if player:hasSkill(self) and event == fk.GameStart then
          return true
      end
    end,
    on_cost = function (self, event, target, player, data)
      if event == fk.GameStart then
        return true
      end
    end,
    on_use = function(self, event, target, player, data)
      local room = player.room
      local card_derivecards = { {"savage_assault", Card.Spade,6}, {"savage_assault", Card.Spade, 7},
      {"savage_assault", Card.Spade, 8},{"savage_assault", Card.Spade, 9} }   
      if event == fk.GameStart then
        local cids = table.filter(U.prepareDeriveCards(room, card_derivecards, "aoe__huiwan_derivecards"), function (id)
          return room:getCardArea(id) == Card.Void
        end)    
        if #cids > 0 then
          room:obtainCard(player, table.random(cids, 3), false, fk.ReasonPrey, player.id, self.name, MarkEnum.DestructIntoDiscard)
        end
    end
    end,
  }
Fk:loadTranslationTable{
  ["aoe__huiwan"] = "会玩",
  [":aoe__huiwan"] = "游戏开始时，你获得三张【南蛮入侵】。" ,
  ["savage_assault"] = "南蛮入侵",
}

local aoe__huchuquan = General(extension, "aoe__huchuquan", "qun", 4)
aoe__huchuquan:addSkill("os__fupan")
aoe__huchuquan:addSkill(aoe__huiwan)
Fk:loadTranslationTable{
    ["aoe__huchuquan"] = "会玩呼厨泉",
}
local aoe__panghui = General(extension, "aoe__panghui", "wei", 4)
aoe__panghui:addSkill("yiyong")
aoe__panghui:addSkill("suchou")
aoe__panghui:addSkill(aoe__huiwan)
Fk:loadTranslationTable{
  ["aoe__panghui"] = "会玩庞会",

}
local aoe__xurong = General(extension, "aoe__xurong", "qun", 4)
aoe__xurong:addSkill(aoe__huiwan)
aoe__xurong:addSkill("xionghuo")
aoe__xurong:addSkill("shajue")
Fk:loadTranslationTable{
  ["aoe__xurong"] = "会玩徐荣",
}
local aoe__quyi = General(extension, "aoe__quyi", "qun", 4)
aoe__quyi:addSkill(aoe__huiwan)
aoe__quyi:addSkill("fuji")
aoe__quyi:addSkill("jiaozi")
Fk:loadTranslationTable{
  ["aoe__quyi"] = "会玩麴义",
}
local aoe__lidian = General(extension, "aoe__lidian", "qun", 4)
aoe__lidian:addSkill(aoe__huiwan)
aoe__lidian:addSkill("xunxun")
aoe__lidian:addSkill("ty__wangxi")
Fk:loadTranslationTable{
  ["aoe__lidian"] = "会玩李典",
}
local aoe__huaman = General(extension, "aoe__huaman", "qun", 4)
aoe__huaman:addSkill(aoe__huiwan)
aoe__huaman:addSkill("manyi")
aoe__huaman:addSkill("mansi")
aoe__huaman:addSkill("souying")
aoe__huaman:addSkill("zhanyuan")
aoe__huaman:addRelatedSkill("xili")
Fk:loadTranslationTable{
  ["aoe__huaman"] = "会玩花鬘",
}
local aoe__weiyan = General(extension, "aoe__weiyan", "qun", 4)
aoe__weiyan:addSkill(aoe__huiwan)
aoe__weiyan:addSkill("ol_ex__kuanggu")
aoe__weiyan:addSkill("ol_ex__qimou")
Fk:loadTranslationTable{
  ["aoe__weiyan"] = "会玩魏延",
}




return extension  